package com.woniuxy.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: 马宇航
 * @Todo: 我的第一个controller类，但是，大家不要去记这种写法！这个写法是为了同学们过渡二阶段的servlet！
 * @DateTime: 22/08/24/0024 11:37
 * @Component: 成都蜗牛学苑
 **/
public class MyFirstContrller implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("message","我的第一个MVC项目跑起来了，欧耶！");
        modelAndView.setViewName("/index.jsp");
        return modelAndView;
    }
}
